package com.exam.baidu;

import java.util.Scanner;

/**
 * date:
 * description:
 */
public class Solution003 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int Q = scanner.nextInt();
        for (int i = 0; i < Q; i++) {
            String str = scanner.next().trim().substring(0, N);
            System.out.println(3);
        }
    }
}
